<?php
/**
 * Introduction: 活动秀图,需用户登录
 * @author: 杨陈鹏
 * @email: yangchenpeng@cdlinglu.com
 */

namespace WeChat\Controller\Activity;


use Common\Controller\WeChat\SignController;

class ShowController extends SignController
{

    /**
     * Introduction: 加入活动
     * @author: 杨陈鹏
     * @email: yangchenpeng@cdlinglu.com
     */
    public function jion()
    {

        $logic = D('Common/Activity','Logic');

        $data = I('post.data');

        $activity_id = $data['activity_id'];

        outPut($logic::jionActivity($activity_id,self::$uid));


    }
    /**
     * Introduction: 发布秀图
     * @author: 杨陈鹏
     * @email: yangchenpeng@cdlinglu.com
     */

    /*

    var data = {
        data:{
              activity_id: 34,
              title:   'asd',
              content: '',
              images:['sdfas.jpg','asdfas.jpg']
        }
    }

     */
    public function create()
    {

        $logic = D('Common/Activity','Logic');

        $data = I('post.data');

        $data['uid'] = self::$uid;

        outPut($logic::addShow($data));


    }
    /**
     * Introduction: 评论秀图
     * @author: 杨陈鹏
     * @email: yangchenpeng@cdlinglu.com
     */

    /*

    var data = {
        data:{
              activity_show_id: 34,
              activity_id:   12',
              content: '',
        }
    }

     */
    public function comment()
    {

        $logic = D('Common/Activity','Logic');

        $data = I('post.data');

        $data['uid'] = self::$uid;

        outPut($logic::showComment($data),true);


    }

    /**
     * Introduction: 用户禅参与的活动列表
     * @author: 杨陈鹏
     * @email: yangchenpeng@cdlinglu.com
     */
    public function memberActivityList()
    {

        $data = I('post.data');

        $logic = D('Common/Activity','Logic');

        $page = I('post.page',1);
        $nums = I('post.page',20);

        outPut($logic::memberActivityList($data,'*',$page, $nums,self::$uid));
    }
}